/**
 * 推介位枚举类
 */
package com.hanhai.zrb.model.common.enums;

import java.util.ArrayList;
import java.util.List;

public enum RecommendEnum {
	
	APP_HOT_POINT(1,"APP资讯一级页面热点置顶推介位"),
	APP_REC_PROJECT(2,"APP推介项目");
	
	private int type;//区分推介位类型,1 表示资讯推介位; 2 表示项目推介位
	
	private String desc;
	

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	private RecommendEnum(int type,String desc) {
		this.type = type;
		this.desc = desc;
	}
	
	public static List<RecommendEnum> getInfoRecommendEnum(){
		List<RecommendEnum> list = new ArrayList<RecommendEnum>();
		for(RecommendEnum info :RecommendEnum.values()){
			if(info.getType()==1){
				list.add(info);
			}
		}
		return list;
	}
	
	
	public static List<RecommendEnum> getProjectRecommendEnum(){
		List<RecommendEnum> list = new ArrayList<RecommendEnum>();
		for(RecommendEnum info :RecommendEnum.values()){
			if(info.getType()==2){
				list.add(info);
			}
		}
		return list;
	}
	
	public static List<String> getInfoRecommendEnumName(){
		List<String> list = new ArrayList<String>();
		for(RecommendEnum info :RecommendEnum.values()){
			if(info.getType()==1){
				list.add(info.name());
			}
		}
		return list;
	}
	
	public static List<String> getProjectRecommendEnumName(){
		List<String> list = new ArrayList<String>();
		for(RecommendEnum info :RecommendEnum.values()){
			if(info.getType()==2){
				list.add(info.name());
			}
		}
		return list;
	}
	 
	public static void main(String[] args) {

//		RecommendEnum.getInfoRecommendEnum();
//		RecommendEnum.getProjectRecommendEnum();
//		RecommendEnum.getInfoRecommendEnumName();
//		RecommendEnum.getProjectRecommendEnumName();
		System.out.println(RecommendEnum.APP_REC_PROJECT);
		System.out.println(RecommendEnum.APP_REC_PROJECT.name().equals("APP_REC_PROJECT"));
	}
}
